<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>

<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";

	List allLifeInfo = (List) request.getAttribute("allLifeInfo");
	String pageStr = (String) request.getAttribute("pageStr");
	String typeId = (String) request.getAttribute("typeId");
	int allCounts = (Integer) request.getAttribute("allCounts");
	int pageNum = (Integer) request.getAttribute("pageNum");
	int pageCount = (Integer) request.getAttribute("pageCount");
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<base href="<%=basePath%>" />

		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta name="KEYWords" content="邯郸001" />
		<meta name="DEscription" content="邯郸001" />
		<meta name="Author" content="邯郸001" />
		<meta name="Robots" content="all" />
		<meta http-equiv="windows-Target" content="_top" />
		<meta http-equiv="MSThemeCompatible" content="NO" />
		<script charset="utf-8" type="text/javascript"  src="js/jquery-1.2.6.min.js"></script>
		<script charset="utf-8" type="text/javascript"  src="js/jquery.form.js"></script>		
		<link href="css/list.cmb.__1335176338__.css" rel="stylesheet"
			type="text/css" />
		<title>【邯郸-屌丝贴】</title>

<script type="text/javascript">
//分页函数
function getLifeInfoList(pageNum) {
	window.location.href = "doLifeInfo.do?opers3=getLifeInfoList&typeId=" + <%=typeId%> + "&pageNum=" + pageNum;
}

$(document).ready(function() {
	//提交参数
	var options = {	
		   dataType:'text',		   
		   success: function(message){
		   		document.getElementById("operateMessage").innerHTML = message;		   		
		   		window.setTimeout("document.getElementById('operateMessage').innerHTML = ''; document.getElementById('Content').value = ''; document.getElementById('random').value = '';",1500);		   		
		   		$('#Submit').attr("disabled",false);
		   },
		   
		   //验证表单
		    beforeSubmit: function() {
		    	var random = $('#random').attr("value");	
		    	var title = $('#title').attr("value");	
				var content = $('#Content').attr("value");	
				
				
				if (title == '' || title == null) {
					alert('您的标题不能为空！');
					document.myform.title.focus();
					return false;
				} else if (title.length > 100) {
					alert('标题不能超过100个字！');
					document.myform.title.focus();
					return false;
				} else if (content == '' || content == null) {
					alert('您的内容不能为空！');
					document.myform.Content.focus();
					return false;
				} else if (content.length > 2000) {
					alert('信息内容超过2000个字！');
					document.myform.Content.focus();
					return false;
				} else if (random == '' || random == null) {
					alert('您的验证码为空！');
					document.myform.random.focus();
					return false;
				}
				$('#Submit').attr("disabled",true);
		    	return true;
		    }
	};

	//提交操作
    $('#myform').ajaxForm(options);
});
</script>

	</head>
	<body>
		<div style="width: 960px; margin: 0 auto;">
			<table width=960px height=25 bgcolor=#ffffff border=0 cellspacing=0 cellpadding=2>
				<tr>
					<td align="right"
						style="color: #424242; padding-right: 10px; font-size: 12px;">
						<a href="#" style="color: #424242; font-size: 12px;"></a>
					</td>
				</tr>
			</table>
		</div>				
				<div id="GcnADId1"></div>
				<table class="choose_tab" width="100%">
					<tr>
						<td>
							<strong><font size='2'>邯郸【 屌丝贴 】</font></strong>
							&emsp;
							<%
								if (!typeId.equals("6")) {
							%>	
							<a style="TEXT-DECORATION: underline"
								href="javascript:defsendinfor();"><font>发布信息</font>
							</a>
							<%
								}
							%>
							<script language="javascript"> 
								function defsendinfor() {
									window.location.hash = "#defsendinfor";
								}
							</script>
						</td>
						<td align="right">
							&nbsp;				
						</td>
					</tr>
				</table>
				<table class="list_noimg" width="100%">
					<tr>
						<td colspan="2" align="center">
							广告链接,虚位以待！
						</td>
					</tr>
				</table>
				<c:forEach var="lifeInfo" items="<%=allLifeInfo%>">
					<table class="list_noimg" width="100%">
						<tr>
							<td align="left">							
								<a href="doLifeInfo.do?opers3=getCommonListByInfoId&infoId=${lifeInfo.id}" target="_blank"><font class="list_title">${lifeInfo.content}</font></a>
							</td>
							<td align="right">
								${lifeInfo.subDate} <font color="red" size="2" style="font-weight: bold;">点击次数  ${lifeInfo.kindId}</font>							
							</td>
						</tr>
					</table>
			  </c:forEach>

				<div style="" id="ad_container_link">
					<ul class="list-ads3">
						<li>
							广告链接,虚位以待！
						</li>
					</ul>
				</div>
				<div class="fenye">
					<ul class="pageLink">
						<li>
							<%=pageStr%>
						</li>
					</ul>
				</div>
				<div align="center">
					<ul>
						<li>
							<font size="2" color="blue">共 <%=pageCount %> 页&nbsp;当前第 &nbsp;<%=pageNum %>/<%=pageCount %>&nbsp;页&nbsp;总记录数&nbsp;<%=allCounts %></font>
						</li>
					</ul>
				</div>
					<h1>
						<a name="defsendinfor"><font color="#296fcf">发布信息</font> </a>
					</h1>
					<form id="myform" name="myform" action="AjaxOperateSaveDiaoSiServlet" method="post">
					<table width="980px" border="0" cellspacing="0" cellpadding="0">
						<tr bgcolor="#e0e0e0">
							<td>
								<table width="980px" border="0" cellspacing="1" cellpadding="7">
									<tbody>
										<tr>
											<td colspan="2" align="center" height="30" bgcolor="#ffffff">

												<font color="#FF0000">&nbsp;&nbsp; <span
													style="font-weight: 700; background-color: #FFFF00">&nbsp;
														注意：填写虚假信息，永久封杀！</span> </font>
											</td>
										</tr>
										<tr>
											<td align="center" width="15" height="88" bgcolor="#ffffff"
												align="center">
												<span> 标题</span>：
											</td>
											<td class="zi_hei_12_21" width="900px" bgcolor="#ffffff"
												align="left">
												&nbsp;
												<input id="title" name="title" type="text" size="15" style="width: 350px;" />
												<div id="body_length">
													&nbsp;
													<font color="#ff0000">&nbsp;最多可输入字符数：100</font>
												</div>


											</td>
										</tr>
										<tr>
											<td align="center" width="152" height="88" bgcolor="#ffffff"
												align="center">
												<span> 内容</span>：
											</td>
											<td class="zi_hei_12_21" width="900px" bgcolor="#ffffff"
												align="left">
												&nbsp;
												<textarea id="Content" tabindex="5" name="Content"
													cols="140" rows="10"></textarea>
												<span class="zi_bai_12_c"><span class="style6"><a
														id="top" name="top"></a> </span> </span>
												<div id="body_length">
													&nbsp;
													<font color="#ff0000">&nbsp;最多可输入字符数：2000</font>
												</div>
											</td>
										</tr>
										<tr>
											<td bgcolor=#ffffff height=34 align=center align="center"></td>
											<td bgcolor=#ffffff colspan=2 align=left>
												<table id=table64 border=0 cellspacing=0 cellpadding=0
													width="100%">
													<tbody>
														<tr>
															<td>
																<font color="green" size=2>&nbsp;<strong>您目前是以"邯郸居民"名义发表&nbsp;&nbsp;(无须注册即可发贴)</strong> </font>
															</td>
														</tr>
													</tbody>
												</table>
											</td>
										</tr>
										<tr>
											<td class="zi14_black_xi" align="center" height="53"
												bgcolor="#FFFFFF" align="center">
												验证码：
											</td>
											<td class="zi_hei_12_21" bgcolor="#f1f3f5" align="left">
												<table id="table24" width="100%" height="50" border="0"
													cellpadding="0" cellspacing="0">
													<tbody>
														<tr>
															<td class="zi_hei_12_21" width="32%" height="19"
																bgcolor="#FFFFFF">
																&nbsp;
																<input type="text" name="random" id="random" size="12"/>
																	<input type="hidden" name="typeId" id="typeId" value="<%=typeId%>"/>
		
																<img id="xMan" src="imgcode" onclick="javascript:changeOne();"/>
																<a href="javascript:changeOne();">换一张</a> 
																	<script type="text/javascript">
																		function changeOne() {
																			//$('#xMan').attr('src', 'imgcode');
																			document.getElementById("xMan").src="imgcode?"+Math.random();
																		}
																	</script>
															</td>
														</tr>
											</tbody>
												</table>
											</td>
										</tr>

										<tr bgcolor="#FFFFFF" align="center">
										<td colspan="2" style="font-size: 12px;" align="center" height="50">
											<span id="operateMessage"></span><br/>
											<input class="sub_1" value="马上发布" name="Submit" type="submit" id="Submit"/>
										</td>
									</tr>
									</tbody>
								</table>
							</td>
						</tr>
					</table>
				</form>
	</body>
</html>
